<template>
  <div ref="border6" class="border-wrap" :style="`box-shadow: inset 0 0 25px 3px ${borderColor[0]}`">
    <svg class="border" :width="width" :height="height">
      <polygon
        :fill="bgColor"
        :points="`
        4, 0 ${width - 4}, 0 ${width}, 4 ${width}, ${height - 4} ${width - 4}, ${height}
        4, ${height} 0, ${height - 4} 0, 4
      `"
      />
    </svg>
    <svg
      v-for="item in border"
      :key="item"
      width="150px"
      height="150px"
      :class="`${item} border`"
    >
      <polygon
        :fill="borderColor[1]"
        points="40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3"
      />
    </svg>
  </div>
</template>

<script>
export default {
  props: {
    bgColor: {
      type: String,
      default: () => 'transparent'
    },
    borderColor: {
      type: Array,
      default: () => ['#2259ee', '#d3e1f8']
    },
    width: {
      type: Number,
      default: () => 0
    },
    height: {
      type: Number,
      default: () => 0
    }
  },
  data() {
    return {
      border: ['left-top', 'right-top', 'left-bottom', 'right-bottom']
    }
  }
}
</script>

<style scoped="scoped" lang="less">
    .border-wrap{
          border-radius: 6px;
    }
  .dv-border-svg-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;

    polyline {
      fill: none;
    }
  }
 .border {
   position: absolute;
   display: block;
 }

 .right-top {
   right: 0px;
   transform: rotateY(180deg);
 }

 .left-bottom {
   bottom: 0px;
   transform: rotateX(180deg);
 }

 .right-bottom {
   right: 0px;
   bottom: 0px;
   transform: rotateX(180deg) rotateY(180deg);
 }

 .border-box-content {
   position: relative;
   width: 100%;
   height: 100%;
 }
</style>
